﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page trimDirectiveWhitespaces="true" %>
<%@page import="com.opensymphony.module.sitemesh.tapestry.Title"%>
<%@page import="com.sun.xml.txw2.Document"%>
<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp"/>
<fmt:setBundle basename="bundles.application-resources"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String Title = "";
Title = request.getHeader(Title);
String referer = request.getHeader("Referer");
if(referer==null) referer="";
%>
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="ie6 ielt8"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="ie7 ielt8"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="ie8"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>${my:i18n('name') } - 用户登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="images/favicon.ico" />

<!-- Set render engine for 360 browser -->
<meta name="renderer" content="webkit">

<!-- No Baidu Siteapp-->
<meta http-equiv="Cache-Control" content="no-siteapp"/>

<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="assets/i/app-icon72x72@2x.png">

<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Amaze UI"/>
<link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">

<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="assets/i/app-icon72x72@2x.png">
<meta name="msapplication-TileColor" content="#0e90d2">

<!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
<!--
<link rel="canonical" href="http://www.example.com/">
-->

<!-- basic styles -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
<link href="assets/css/font-awesome.min.css" rel="stylesheet" />

<link href="assets/css/jquery.gritter.css" rel="stylesheet"/>

<link href="assets/css/ace.min.css" rel="stylesheet" />
<link href="assets/css/ace-rtl.min.css" rel="stylesheet" />
<link href="assets/css/ace-skins.min.css" rel="stylesheet" />
<link href="assets/css/datepicker.css" rel="stylesheet" />
<link href="assets/css/bootstrap-timepicker.css" rel="stylesheet" />
<link href="assets/css/chosen.css" rel="stylesheet" />

<link href="css/gritter.css" rel="stylesheet"/>
<link href="css/h2.css" rel="stylesheet" />
<link href="css/h2-base.css" rel="stylesheet" />
<link href="css/h2-revise.css" rel="stylesheet" />

<!-- basic scripts -->
<!--[if !IE]> -->
<script type="text/javascript">
window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>" + "<" + "script>");
</script>
<!-- <![endif]-->

<!--[if IE] -->
<script type="text/javascript">
 window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>"+"<"+"script>");
</script>
<!-- [endif]-->

<script type="text/javascript">
//if ("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>" + "<" + "script>");
</script>
<script src="assets/js/bootstrap.min.js"></script>

<script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script>
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
<script src="assets/js/jquery.slimscroll.min.js"></script>
<script src="assets/js/jquery.easy-pie-chart.min.js"></script>
<script src="assets/js/jquery.sparkline.min.js"></script>

<script src="js/jquery.gritter.js" type="text/javascript"></script>
<script src="js/lhq_form_validate.js"></script>
<script src="js/highlight.js"></script>
<script src="js/bootbox-4.4.0.js"></script>
<script src="js/ajaxfileupload.js"></script>

<script src="js/message_${my:i18n('lang') }.js"></script>
<script src="js/common.js"></script>

<script src="assets/js/flot/jquery.flot.min.js"></script>
<script src="assets/js/flot/jquery.flot.pie.min.js"></script>
<script src="assets/js/flot/jquery.flot.resize.min.js"></script>

<!-- ace scripts -->
<!-- ace settings handler -->
<script src="assets/js/ace-extra.min.js"></script>
<script src="assets/js/ace-elements.min.js"></script>
<script src="assets/js/ace.min.js"></script>
<script src="assets/js/date-time/bootstrap-datepicker.min.js"></script>
<script src="assets/js/date-time/bootstrap-timepicker.min.js"></script>
<script src="assets/js/chosen.jquery.min.js"></script>
<script src="assets/js/fuelux/fuelux.tree.min.js"></script>

<link rel="stylesheet" type="text/css" href="source/css/login.css" />
<style>
    .forMsg {
        text-align: left;
        padding-left:35px;
    }
</style>
</head>
<body>
<div class="container">
	<section id="content">
		<form class="login-form">
            <input type="hidden" id="referer" value="${referer }"/>
            <h1 style="margin-top:25px">${my:i18n('name') }登录</h1>
			<div>
				<input type="text" placeholder="登录账号" lhq-validate="[{required:true,msg:'登录账号不能为空。'},{
                		reg:'/^(([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9]){2,20})$/',
                		msg:'请输入有效的登录账号。'
                	}]" id="username" value=""/>
			</div>
			<div style="margin-top:28px; margin-bottom:25px;">
				<input type="password" value="" placeholder="密码" lhq-validate="[{required:true,msg:'密码不能为空。'},{minLen:6,msg:'密码太不能少于6位。'},{maxLen:20,msg:'密码不能多于20位。'}]" id="password" />
			</div>
			<div>
				<input id="loginBtn" type="submit" value="登录" />
			</div>
		</form><!-- form -->
	</section><!-- content -->
</div><!-- container -->
 <script>
     $(function () {
         $('#loginBtn').click(function () {
             preventDefault(arguments[0]);
             if (validateForm('.login-form') == false) {
                 flash('.login-form .validateErr'); return false;
             }
             var username = $('#username').val().trim();
             var password = $('#password').val().trim();

             var params = { username: username, password: password };

             loadingModal('正在登录……');
             $.post("./checkLogin", params, function (resp) {
                 loadingModal();
                 if (checkResponse(resp) == false) return;

                 if (resp.data.to_repwd) location.href = "/User/Password?init=1";

                 else if ($('#referer').val() != '') location.href = $('#referer').val();
                 else {
                     location.href = "/";
                 }
             });
         });
     });
 </script>
</body>
</html>